package pkev.xgrapher.common.entity;

import pkev.xgrapher.common.CoordinatesProcessor;
import pkev.xgrapher.transformation.AbstractTransformation;

import java.awt.*;

public class XFlowGraphics {
    private Graphics g;
    private AbstractTransformation transformation;

    public XFlowGraphics(Graphics g, AbstractTransformation transformation) {
        this.g = g;
        this.transformation = transformation;
    }

    public Graphics getG() {
        return g;
    }

    public void setG(Graphics g) {
        this.g = g;
    }

    public AbstractTransformation getTransformation() {
        return transformation;
    }

    public void setTransformation(AbstractTransformation transformation) {
        this.transformation = transformation;
    }

    public void drawLine(double x1, double y1, double x2, double y2) {
        g.drawLine(CoordinatesProcessor.processX(x1), CoordinatesProcessor.processY(y1),
                CoordinatesProcessor.processX(x2), CoordinatesProcessor.processY(y2));
    }

    public void drawString(String str, int x, int y) {
        g.drawString(str, CoordinatesProcessor.processX(x), CoordinatesProcessor.processY(y));
    }

    public void drawCirle(double x, double y, int r) {
        g.drawOval(CoordinatesProcessor.processX(x), CoordinatesProcessor.processY(y), r, r);
    }


}
